<?php

/**
 * Tweets a message from the user whose user token and secret you use.
 *
 * Although this example uses your user token/secret, you can use
 * the user token/secret of any user who has authorised your application.
 *
 * Instructions:
 * 1) If you don't have one already, create a Twitter application on
 *      http://dev.twitter.com/apps
 * 2) From the application details page copy the consumer key and consumer
 *      secret into the place in this code marked with (YOUR_CONSUMER_KEY
 *      and YOUR_CONSUMER_SECRET)
 * 4) Visit the 'My Access Token' screen linked to from your application
 *      details page
 * 5) Copy the user token and user secret into the place in this code marked
 *      with (A_USER_TOKEN and A_USER_SECRET)
 * 6) Visit this page using your web browser.
 *
 * @author themattharris
 */

require 'tmhOAuth.php';
require 'tmhUtilities.php';

function tweet($status) {

    $tmhOAuth = new tmhOAuth(array(
      'consumer_key'    => 'C7EiQHkRyRcKJF1mPXLQ',
      'consumer_secret' => '2zdRCTtIScIjM5YHYqkpnjUqQHmD73r5TjrRB0Nfgk',
      'user_token'      => '334413785-biZNxDmZUzOTT6AJ5F7zjowRspoUeHHR728BByLA',
      'user_secret'     => 'T1PP9s8nIxbdXVS3XyYckroiy7nOQhACfo04lpXQ',
    ));

    $code = $tmhOAuth->request('POST', $tmhOAuth->url('1/statuses/update'), array(
      'status' => $status
    ));
}

?>